package com.guoxue.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.guoxue.dao.IPlanChapterDao;
import com.guoxue.domain.PlanChapterConfigVo;
@Repository
public class PlanChapterDaoImpl extends BaseDaoImpl<PlanChapterConfigVo> implements IPlanChapterDao{

	@Override
	public List<PlanChapterConfigVo> getPlanChapterById(int planChapterdx, int planChapterdy) {
		return find("FROM PlanChapterConfigVo p WHERE p.planChapterId BETWEEN ? AND ?",new Object[] {planChapterdx,planChapterdy});
	}

	@Override
	public List<PlanChapterConfigVo> getPlanChapterList() {
		return find("FROM PlanChapterConfigVo p");
	}

	@Override
	public void deletePlanChapter(int id) {
		executeHql("DELETE FROM PlanChapterConfigVo p WHERE p.planChapterId=?", new Object[] {id});
	}

	@Override
	public void savePlanChapter(PlanChapterConfigVo pcc) {
		saveOrUpdate(pcc);
	}
}
